<html>
    <head><link rel="shortcut icon" href="./blockly/ini/site/Loge.svg"type="image/x-icon"></head>
    <body>
        <a id="a"></a>
        <script>
            var phptext = `
            <?php
            $myfile = fopen($_POST['name'], "w") or die("Unable to open file!");
            fwrite($myfile,$_POST['text']);
            fclose($myfile);
            echo $_POST['text'];
            ?>
            `;

            function d(text, name, type) {
            var a = document.getElementById("a");
            var file = new Blob([text], { type: type });
            a.href = URL.createObjectURL(file);
            a.download = name;
            a.dispatchEvent(new MouseEvent('click', { 'bubbles': false, 'cancelable': true }));
        }
            d(phptext, 'helper.php', 'text/plain');
        </script>
    </body>
</html>